package com.hc.model.code04.test8;

import java.util.List;

/**
 * @version v1.0
 * @ClassName: StudentIteratorImpl
 * @Description: 具体的迭代器实现类
 * @Author: HC
 */
public class StudentIteratorImpl implements StudentIterator{

    // 封装学生实体
    private List<Student> list;
    private int position;

    public StudentIteratorImpl(List<Student> list) {
        this.list = list;
        position = 0;
    }

    @Override
    public boolean hashNext() {
        return position < list.size();
    }

    @Override
    public Student next() {
        return list.get(position++);
    }
}
